<template>
	<view>
		<nav-bar
			:leftSet="leftSet"
			:rightSet="rightSet"
			:middleSet="middleSet"
			background-color="#6899F7"
			status-bar="true"
			fixed="true"
			rightClick="小智"
			@myFun="myFun"	
			@clickLeft="back"
			@clickRight="metu">
		</nav-bar>
		<custom-content>
			<search-bar 
				:placeholder="searchData.placeholder"
				:radius="searchData.radius"
				:bgColor="searchData.bgColor"
				:clearButton="searchData.clearButton"
				:cancelButton="searchData.cancelButton"
				:cancelText="searchData.cancelText"
				:maxlength="searchData.maxlength"
				@input="inputFun"
				@confirm="confirmFun"
				@cancel="cancelFun"
			/>
		</custom-content>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				leftSet:{
					leftText:"返回",
					leftIcon:"back",
					leftColor:"#000000",
					leftFontSize:"28rpx"
				},
				rightSet:{
					rightText:"群发",
					rightIcon:"",
					rightColor:"#540a03",
					rightFontSize:"28rpx",
				},
				middleSet:{
					title: "我的患者(90)",
					middleColor:"#000000",
					middleFontSize: "28rpx",
				},
				searchData:{
					placeholder:"请输入搜索内容",
					radius:"20",
					bgColor:"#d5d5d5",
					clearButton:"always",//[always|auto|none] 是否显示清除按钮
					cancelButton:"auto",//[always|auto|none] 是否显示取消按钮
					cancelText:"取消",
					maxlength:"100",//输入最大长度
				}
			}
		},
		methods: {
			back(){
				this.$funs.show("left",0)
				uni.$on('add', (e)=>{
					console.log(e)
				})
			},
			metu(){
				this.$funs.show("right",0)
				uni.$emit('add', {
				    data: 2
				})
			},
			myFun(){
				this.$funs.show("我是自定义",0)
			},
			////// 搜索
			inputFun(e){
				console.log(e.value)
			},
			confirmFun(e){
				console.log(e.value)
			},
			cancelFun(e){
				console.log(e.value)
			}
		},
	}
</script>

<style>

</style>
